- if @backlog.archived?
  .not-editable-notice
    This backlog is archived and is not editable.
    %br
    If you would like to make changes to this backlog, change the Backlog Status to Active
- elsif @backlog.is_snapshot?
  .not-editable-notice.snapshot
    Please note that you are viewing a snapshot's settings that are not editable
- elsif cannot? :full
  .not-editable-notice.no-permission
    Please note that you do not have permission to edit the settings of this backlog and can only view them


= f.label :name, @backlog.is_snapshot? ? 'Snapshot name' : 'Name the backlog'
.label-hint
  ("Website build", "iPhone App", etc.)
.input-row
  = f.text_field :name, :class => 'important'

- unless @backlog.is_snapshot?
  .label-spacer

  = f.label :company, "Is this backlog for a client or company other than yours (#{truncate(@backlog.account.name, :length => 40)})?"
  .input-row
    = f.radio_button :has_company?, false
    = label_tag 'backlog_has_company_false', 'No, this is an internal project', :class => 'light', :id => 'has_company_false_label'
  .input-row
    = f.radio_button :has_company?, true
    = label_tag 'backlog_has_company_true', 'Yes, I would like to assign this to a company', :class => 'light', :id => 'has_company_true_label'
  .client-select
    .existing
      = label_tag 'backlog_company_id', 'Which company?'
      .input-row
        = select(:backlog, "company_id", @backlog.account.companies.order("name").map { |p| [ truncate(p.name, :length => 50), p.id ] } )
        .new-company
          or
          = link_to 'add a new company', '#', :id => 'add_new_company'
    .new
      = label_tag 'company_name', 'New company name'
      .input-row
        = text_field_tag :company_name
        .select-existing
          or
          = link_to 'select an existing company', '#', :id => 'select_an_existing_company'

= render :partial => '/_shared/backlog_preferences', :locals => { :context => @backlog, :namespace => 'backlog', :f => f }

= f.label :scoring_rule, "Scoring rule for stories", :class => 'spacer vtip', :title => 'The scoring rule is used to ensure you enter valid scores when scoring your backlog stories.  You can change this at any point in the future'
- ScoringRule.all.each do |rule|
  .input-row
    = f.radio_button :scoring_rule_id, rule.id, @backlog.scoring_rule.blank? ? (rule == ScoringRule.default ? { :checked => 'checked' } : {}) : (rule == @backlog.scoring_rule ? { :checked => 'checked' } : {})
    = f.label "scoring_rule_id_#{rule.id}", rule.title, :class => 'light'
    .form-hint.inline
      = "(#{rule.description})"

- # if the defaults are not yet set, then indicate this to the view so that Yes, I would like to use estimates is shown by default
= hidden_field_tag :account_defaults_set, @backlog.account.defaults_set